package com.oo.abstractAndInterface_6.shape;

import java.util.Scanner;

/**
 * ShapeTest--${description}
 *
 * @author: Jovi
 * @createTime: 2017-04-18 16:33
 **/
public class ShapeTest {

    public static void main(String[] args) {

        Parallelogram parallelogram = new Parallelogram();
        System.out.println("Please enter the parallelogram bottom：");
        Scanner sc = new Scanner(System.in);
        int bottom = sc.nextInt();
        System.out.println("Please enter the parallelogram side：");
        int lengthSide = sc.nextInt();
        System.out.println("Pleasr enter the parallelogram high：");
        int high = sc.nextInt();
        parallelogram.setSide(lengthSide);
        parallelogram.setBottom(bottom);
        parallelogram.setHigh(high);
        System.out.println("The parallelogram perimeter is" + parallelogram.perimeter());
        System.out.println("The parallelogram area is" + parallelogram.area());

        System.out.println("-------------------------");
        Triangle triangle = new Triangle();
        System.out.println("Please enter the bottom of the triangle：");
        int bottom1 = sc.nextInt();
        System.out.println("Please enter the high of the triangle：");
        int high1 = sc.nextInt();
        System.out.println("Please enter the side of the triangle");
        int side1 = sc.nextInt();
        int side2 = sc.nextInt();

        triangle.setSide1(side1);
        triangle.setSide2(side2);
        triangle.setBottom(bottom1);
        triangle.setHigh(high1);

        System.out.println("The triangle perimeter is" + triangle.perimeter());
        System.out.println("The triangle area is" + triangle.area());
    }
}
